<h3 id="title-dialog-legend" class="title-dialog .noselect">Legend <span>(Click to expand)</span></h3>
<span class="close"><svg><use xlink:href="#shape-close"></use></svg></span>
{{#if iso}}
  <ul class="categories {{#if iso}}divided{{/if}}">
    <h2>{{name}} data</h2>
    {{#each categoriesIso}}
      <li class="category {{#if this.closed}}closed{{/if}}">
        {{#each this}}
          {{#if @first}}
            <span data-category_slug="{{this.category_status}}" class="category-name" style="color: {{this.category_color}}; border-color: {{this.category_color}};">
              {{this.category_name}}
              <em>({{../../layers_length}})</em>
            </span>
          {{/if}}
        {{/each}}
        <ul class="layers {{#if this.closed}}closed{{/if}}">
          {{#each this}}
            <li class="layer">
              <span class="layer-name">
                <i class="circle" style="color:{{this.title_color}};"></i>
                {{this.title}}
                {{#if this.subtitle}}<span class="subtitle">{{this.subtitle}}</span>{{/if}}
                <a href='#' class='layer-close' data-slug="{{this.slug}}"><span>Delete</span> <svg><use xlink:href="#shape-close"></use></svg></a>
                {{#if this.source}}
                <a href='#' data-source='{{this.source}}' class='source'><svg><use xlink:href="#shape-info"></use></svg></a>
                {{/if}}
              </span>
              {{#if this.detailsTpl}}
                {{{this.detailsTpl}}}
              {{/if}}
              {{#if this.sublayer}}
                <div class="layer-sublayer" data-sublayer="{{this.sublayer}}">
                  <span class="onoffswitch {{this.geographic}} {{#if this.geographic}}style="background-color:#f69;"{{/if}}"><span></span></span>
                  <div class="sublayer-title">Geographic coverage</div>
                </div>
              {{/if}}
            </li> {{!-- /layer --}}
          {{/each}}
        </ul>  {{!-- /layers --}}
      </li> {{!-- /category --}}
    {{/each}}
  </ul> {{!-- /categories --}}
{{/if}}
{{#if categories}}
<ul class="categories {{#if iso}}divided{{/if}}">
  {{#if iso}}
    <h2>Global data</h2>
  {{/if}}
  {{#each categories}}
    <li class="category {{#if this.closed}}closed{{/if}}">
      {{#each this}}
        {{#if @first}}
          <span data-category_slug="{{this.category_status}}" class="category-name" style="color: {{this.category_color}}; border-color: {{this.category_color}};">
            {{this.category_name}}
            <em>({{../../layers_length}})</em>
          </span>
        {{/if}}
      {{/each}}
      <ul class="layers {{#if this.closed}}closed{{/if}}">
        {{#each this}}
          <li class="layer">
            <span class="layer-name">
              <i class="circle" style="color:{{this.title_color}};"></i>
                {{this.title}}
                {{#if this.subtitle}}<span class="subtitle">{{this.subtitle}}</span>{{/if}}
              <a href='#' class='layer-close' data-slug="{{this.slug}}"><span>Delete</span> <svg><use xlink:href="#shape-close"></use></svg></a>
              {{#if this.source}}
              <a href='#' data-source='{{this.source}}' class='source'><svg><use xlink:href="#shape-info"></use></svg></a>
              {{/if}}
            </span>
            {{#if this.detailsTpl}}
              {{{this.detailsTpl}}}
            {{/if}}
            {{#if this.sublayer}}
              <div class="layer-sublayer" data-sublayer="{{this.sublayer}}">
                <span class="onoffswitch {{this.geographic}}" {{#if this.geographic}}style="background-color:#f69;"{{/if}}><span></span></span>
                <div class="sublayer-title">Geographic coverage<a href='#' data-source='{{this.source}}_source' class='source'><svg><use xlink:href="#shape-info"></use></svg></a></div>

              </div>
            {{/if}}
          </li> {{!-- /layer --}}
        {{/each}}
      </ul>  {{!-- /layers --}}
    </li> {{!-- /category --}}
  {{/each}}
</ul> {{!-- /categories --}}
{{/if}}
<div id="button-box-embed-legend" class="button-box-embed-legend">
  <a id="link-embed-legend" target="_blank" href="#" class="btn green uppercase full-width">View on GFW</a>
</div>
